﻿using System;

class Calculator
{
    public static void Main(string[] args)
    {
        Console.Write("请输入第一个数字：");
        float a = float.Parse(Console.ReadLine());
        Console.Write("请输入第二个数字：");
        float b = float.Parse(Console.ReadLine());
        Console.Write("请输入运算符：");
        char c = (char)Console.Read();

        float ans;
        switch (c)
        {
            case '+':
                ans = a + b;
                Console.WriteLine(a + " + " + b + " = " + ans);
                break;
            case '-':
                ans = a - b;
                Console.WriteLine(a + " - " + b + " = " + ans);
                break;
            case '*':
                ans = a * b;
                Console.WriteLine(a + " * " + b + " = " + ans);
                break;
            case '/':
                if (b == 0)
                    Console.WriteLine("除数为0，不符合要求！");
                else
                {
                    ans = a / b;
                    Console.WriteLine(a + " / " + b + " = " + ans);
                }
                break;
            case '%':
                ans = a % b;
                Console.WriteLine(a + " % " + b + " = " + ans);
                break;
            default:
                Console.WriteLine("输入的运算符不符合标准！");
                break;
        }
        //等待用户输入回车，防止显示信息一闪而过
        Console.ReadLine();
        Console.ReadLine();
    }
}